package com.arui.exception;

/**
 * @Description TODO
 * @Date 2024/8/27 17:33
 * @Created by 10574
 */
public class ServiceException extends RuntimeException {
    /**
     * 错误代码
     */
    private int code;
    /**
     * 错误信息
     */
    private String message;
    public ServiceException(String message) {
        super(message);
        this.code = 500;
        this.message = message;
    }


    public ServiceException(int code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public ServiceException(int code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
